package com.byxy.mysystem.model.testUser;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 详细地址表
 * </p>
 *
 * @author omd
 * @since 2023-02-28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class TestCity extends Model {

    private static final long serialVersionUID = 1L;

    /**
     * ID自增
     */
    @TableId(value = "ID", type = IdType.AUTO)
    private Long id;

    /**
     * 省/市/区
     */
    @TableField("AREA")
    private String area;

    /**
     * 1=省,2=市,3=区
     */
    @TableField("TYPE")
    private String type;

    /**
     * 上级ID
     */
    @TableField("PID")
    private Long pid;

    @TableField(exist = false)
    List<TestCity> children = new ArrayList<>();


}
